home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-03-27 | 90.6 KB | 3,532 lines |
- TABLE OF CONTENTS
- 0001 ini.library/--background--
- 0002 ini.library/iniAddContext
- 0003 ini.library/iniAddContextItem
- 0004 ini.library/iniAllocNameStr
- 0005 ini.library/iniAllocPMem
- 0006 ini.library/iniCheckComment
- 0007 ini.library/iniClose
- 0008 ini.library/iniCreateContext
- 0009 ini.library/iniCreateContextItem
- 0010 ini.library/iniDeleteContext
- 0011 ini.library/iniDeleteContextItem
- 0012 ini.library/iniFloatToStr
- 0013 ini.library/iniFreeContext
- 0014 ini.library/iniFreeContextItem
- 0015 ini.library/iniFreeNameStr
- 0016 ini.library/iniFreePMem
- 0017 ini.library/iniGetArrayLine
- 0018 ini.library/iniGetArrayPos
- 0019 ini.library/iniGetByteA
- 0020 ini.library/iniGetContextItem
- 0021 ini.library/iniGetContextItemData
- 0022 ini.library/iniGetContextItemDataA
- 0023 ini.library/iniGetContextName
- 0024 ini.library/iniGetFloat
- 0025 ini.library/iniGetFloatA
- 0026 ini.library/iniGetLong
- 0027 ini.library/iniGetLongA
- 0028 ini.library/iniGetNumArrays
- 0029 ini.library/iniGetStr
- 0030 ini.library/iniGetStrA
- 0031 ini.library/iniGetWordA
- 0032 ini.library/iniInsertContext
- 0033 ini.library/iniInsertContextItem
- 0034 ini.library/iniIntToStr
- 0035 ini.library/iniOpenDefault
- 0036 ini.library/iniOpenFile
- 0037 ini.library/iniOpenFromFH
- 0038 ini.library/iniOpenMem
- 0039 ini.library/iniPutByteA
- 0040 ini.library/iniPutFloat
- 0041 ini.library/iniPutFloatA
- 0042 ini.library/iniPutLong
- 0043 ini.library/iniPutLongA
- 0044 ini.library/iniPutStr
- 0045 ini.library/iniPutStrA
- 0046 ini.library/iniPutWordA
- 0047 ini.library/iniReadByteA
- 0048 ini.library/iniReadFloat
- 0049 ini.library/iniReadFloatA
- 0050 ini.library/iniReadLong
- 0051 ini.library/iniReadLongA
- 0052 ini.library/iniReadStr
- 0053 ini.library/iniReadStrA
- 0054 ini.library/iniReadWordA
- 0055 ini.library/iniRemContext
- 0056 ini.library/iniRemContextItem
- 0057 ini.library/iniSaveFile
- 0058 ini.library/iniSaveToFH
- 0059 ini.library/iniSetNameStr
- 0060 ini.library/iniSetString
- 0061 ini.library/iniStrToFloat
- 0062 ini.library/iniStrToInt
- 0063 ini.library/iniWriteByteA
- 0064 ini.library/iniWriteFloat
- 0065 ini.library/iniWriteFloatA
- 0066 ini.library/iniWriteLong
- 0067 ini.library/iniWriteLongA
- 0068 ini.library/iniWriteStr
- 0069 ini.library/iniWriteStrA
- 0070 ini.library/iniWriteWordA
- ini.library/--background--
-
- ini.library Copyright © 1999 Seasons. All rights reserved.
-
- Programming by Sebastian "Basty" Vater <cdgs.basty@usa.net>
- Visit Seasons at http://listen.to/floydmon
-
- Freeware - please read the disclaimer in the "ini.guide" supplied
- with this archive.
-
- This document describes ini.library v31.0 or higher. Do not assume
- that previous library releases support the same features.
-
- PURPOSE
-
- The 'ini.library' was created because there was no easy way of
- handling configuration files. Each program had it's own format.
-
- This library tries to help you in making a standard file format for
- configuration files. These files are in plain ASCII, so you can use
- your favourite text editor to edit them, and, in addition, of course,
- you can use the prefs section of your program.
-
-
- OVERVIEW
-
- The initialization files (ini files) are built up as follows:
-
- [Context1]
- Item1 = Long1
- Item2 = Long2
- Item3 = LongA1, LongA2, LongA3,
- LongA4, LongA5, LongA6,
- Item4 = Float1
- Item5 = String1
-
- [Context2]
- Item1 = Float1
- ...
-
- * Easy accessible
-
- The library makes it easy to read/write access those context/item
- fields. You can easily add/remove new items, contexts, etc.
-
- * Comments, etc. are all handled and preserved automatically!
-
- Yes, if you update a context item, the comment after the line
- is preserved. That means, if you update the ini file in a program,
- you don't need to worry about losing anything.
-
- * Both high- and low-level access functions
-
- You can choose between simply access and complex access. Low level
- functions are for complex access, high level functions are for quick
- and easy access. But the high level functions are a little slower.
-
- Enjoy the power and ease of ini.library!
-
- ini.library/iniAddContext
-
- NAME
- iniAddContext -- adds a new freshly allocated context to an INI file
- structure
-
-
- SYNOPSIS
- iniAddContext( iniFile, ContextStr );
- A0 A1
-
- void iniAddContext( struct iniFile *, struct ContextStr *);
-
-
- FUNCTION
- Adds a freshly created context to a specified INI file.
- To add items, you first need to add context items, see there.
-
-
- INPUTS
- iniFile - Pointer to INI structure where to add it
- ContextStr - Freshly context structure to add
-
-
- EXAMPLE
-
-
- NOTES
- You need to call this function to make a *NEW* context available
- to the other functions.
-
-
- BUGS
-
-
- SEE ALSO
- iniCreateContext(), iniFreeContext(), iniRemContext(),
- iniInsertContext(), iniDeleteContext(), <libraries/ini_lib.h>
-
-
- ini.library/iniAddContextItem
-
- NAME
- iniAddContextItem -- adds a new freshly allocated context item to
- an context structure
-
-
- SYNOPSIS
- iniAddContextItem( ContextStr, ContextItemLine );
- A0 A1
-
- void iniAddContextItem( struct ContextStr *,
- struct ContextItemLine *);
-
-
- FUNCTION
- Adds a freshly created context item to a specified context.
-
-
- INPUTS
- ContextStr - Pointer to context structure where to add it
- ContextItemLine - Freshly context item structure to add
-
-
- EXAMPLE
-
-
- NOTES
- You need to call this function to make a *NEW* context item available
- to the other functions.
-
-
- BUGS
-
-
- SEE ALSO
- iniCreateContextItem(), iniFreeContextItem(), iniRemContextItem(),
- iniInsertContextItem(), iniDeleteContextItem(), <libraries/ini_lib.h>
-
-
- ini.library/iniAllocNameStr
-
- NAME
- iniAllocNameStr -- allocate a name string compatible with the library
-
-
- SYNOPSIS
- namestring = iniAllocNameStr( string );
- D0 A0
-
- APTR iniAllocNameStr( char string *);
-
-
- FUNCTION
- Allocates a name string out of a standard C-String. This is required
- if you use own strings in the library handlers.
-
-
- INPUTS
- string - The string to be allocated. Must be null terminated.
-
-
- RESULT
- namestring - The initialized name structure. To deallocate, use
- iniFreeNameStr() on this result.
-
-
- EXAMPLE
-
-
- NOTES
- The namestring is a copy of string, but it's freed via iniFreePMem()
-
-
- BUGS
-
-
- SEE ALSO
- iniFreeNameStr(), iniSetNameStr(), iniSetString()
-
-
- ini.library/iniAllocPMem
-
- NAME
- iniAllocPMem -- allocate MEMF_PUBLIC|MEMF_CLEAR memory like AllocMem()
- but use memory pools if running under OS3.0+
-
-
- SYNOPSIS
- memoryBlock = iniAllocPMem( byteSize );
- D0 D0
-
- APTR iniAllocPMem( ULONG );
-
-
- FUNCTION
- Allocates memory always with MEMF_PUBLIC and MEMF_CLEAR flags set and
- uses, if possible, the OS3.0+ memory pools. I have decided to
- implement this function, because the INI library allocates often
- very small chunks of memory, which is handled more efficiency with
- memory pools.
-
- Each memory pool has a size of 32768 bytes and a threshold of
- 4096 bytes.
-
-
- INPUTS
- byteSize - number of bytes to allocate. Alignment rules are the
- same as in exec.library/AllocMem() and exec.library/AllocPooled()
-
-
- RESULT
- memoryBlock - FALSE if the user cancelled the requester or if something
- prevented the requester from opening. If TRUE, values in the
- requester structure will be set.
-
- If the return value is FALSE, you can look at the result from the
- dos.library/IoErr() function to determine whether the requester
- was cancelled or simply failed to open. If dos.library/IoErr()
- returns 0, then the requester was cancelled, any other value
- indicates a failure to open. Current possible failure codes are
- ERROR_NO_FREE_STORE which indicates there was not enough memory,
- and ERROR_NO_MORE_ENTRIES which indicates no modes were available
- (usually because the application filter hook filtered them all
- away).
-
-
- EXAMPLE
-
-
- NOTES
- Please note that you MUST deallocate memory allocated with
- iniAllocPMem() with iniFreePMem() or it *MAY* crash!
-
- iniAllocPMem() is used always for internal purposes, so that you
- *MUST* allocate all structures used with this lib with this function.
-
-
- BUGS
-
-
- SEE ALSO
- iniFreePMem()
-
-
- ini.library/iniCheckComment
-
- NAME
- iniCheckComment -- Checks if a context line belongs to a comment
-
-
- SYNOPSIS
- success = iniCheckComment( ContextStr, ContextItemLine );
- D0 A0 A1
-
- BOOL iniCheckComment( struct ContextStr *, struct ContextItemLine *);
-
-
- FUNCTION
- Checks if the given context item line is part of a multiline comment.
- This function is mainly for internal use to easy handle the parsing
- of lines.
-
-
- INPUTS
- ContextStr - A pointer to context structure which contains the line
- to be examined.
- ContextItemLine - A pointer to the context item line which should be
- examined.
-
-
- RESULT
- success - TRUE if the line is commented else NULL.
-
-
- EXAMPLE
-
-
- NOTES
-
-
- BUGS
-
-
- SEE ALSO
- <libraries/ini_lib.h>
-
-
- ini.library/iniClose
-
- NAME
- iniClose -- Deallocate a loaded INI file
-
-
- SYNOPSIS
- iniClose( iniFile );
- A0
-
- void iniClose( struct iniFile *);
-
-
- FUNCTION
- This function is used to deallocate the memory required by the
- the loaded INI file. It deallocates everything in the given INI
- file structure.
-
-
- INPUTS
- iniFile - A pointer to the INI file structure to be freed
-
-
- EXAMPLE
-
-
- NOTES
- All memory blocks inside must be allocated using iniAllocPMem() or
- iniAllocNameStr() or it may crash!
-
-
- BUGS
-
-
- SEE ALSO
- iniOpenFile(), iniOpenFromFH(), iniOpenMem(), <libraries/ini_lib.h>
-
-
- ini.library/iniCreateContext
-
- NAME
- iniCreateContext -- Creates a new context chunk to be used
-
-
- SYNOPSIS
- ContextStr = iniCreateContext( ContextName );
- D0 A0
-
- struct ContextStr *iniCreateContext( char ContextName *);
-
-
- FUNCTION
- Creates a new context structure. It can be added with iniAddContext()
- to an INI file structure. The name given mustn't be an AllocNameStr()
- string. Because it's created automatically during the creation
- process..
-
-
- INPUTS
- ContextName - The line string of the context
-
-
- EXAMPLE
-
-
- NOTES
- ContextName is not only the context name itself, but the full line,
- e.g.:
- [ Display ] and not only "Display".
-
-
- BUGS
-
-
- SEE ALSO
- iniCreateContextItem(), iniFreeContext(), iniAddContext(),
- iniInsertContext(), <libraries/ini_lib.h>
-
-
- ini.library/iniCreateContextItem
-
- NAME
- iniCreateContextItem -- creates a new context item to be used
-
-
- SYNOPSIS
- ContextItemLine = iniCreateContextItem( CStr );
- D0 A0
-
- struct ContextItemLine *iniCreateContextItem( char CStr *);
-
-
- FUNCTION
- Creates a new context item line to be used. The string will be used
- as a context line name. Add the result structure to the context
- structure to make it available in the INI file structure.
-
-
- INPUTS
- CStr - A null terminated string which will be stored as a
- iniAllocNameStr() string.
-
-
- RESULT
- ContextItemLine - The context item structure that can be added to
- the desired context.
-
-
- EXAMPLE
-
-
- NOTES
-
-
- BUGS
-
-
- SEE ALSO
- iniCreateContext(), iniFreeContextItem(), iniAddContextItem(),
- iniInsertContextItem(), <libraries/ini_lib.h>
-
-
- ini.library/iniDeleteContext
-
- NAME
- iniDeleteContext -- deletes a context from an INI file structure
-
-
- SYNOPSIS
- iniDeleteContext( ContextStr );
- A0
-
- void iniDeleteContext( struct ContextStr *);
-
-
- FUNCTION
- Deletes a context of an INI file and all its associated lines.
- Memory will not be freed. To deallocate, use iniFreeContext()
-
-
- INPUTS
- ContextStr - The context structure to be deleted
-
-
- RESULT
-
-
- EXAMPLE
-
-
- NOTES
- Please note that this function removes only the node from the
- INI file structure and doesn't deallocate any memory.
-
-
- BUGS
-
-
- SEE ALSO
- iniFreeContext(), iniRemContext(), iniInsertContext(),
- <libraries/ini_lib.h>
-
-
- ini.library/iniDeleteContextItem
-
- NAME
- iniDeleteContextItem -- deletes a context item line from an INI file.
-
-
- SYNOPSIS
- iniDeleteContextItem( ContextItemLine );
- A0
-
- void iniDeleteContextItem( struct ContextItemLine *);
-
-
- FUNCTION
- Deletes a context item line from an INI context. It doesn't
- deallocate any memory, so it can be added otherwise.
-
-
- INPUTS
- ContextItemLine - The pointer of the context item line to be deleted.
-
-
- RESULT
-
-
- EXAMPLE
-
-
- NOTES
- Please note that just the node is removed from the context structure
- and there are no deallocation processes. Use iniFreeContextItem()
- for this purpose.
-
-
- BUGS
-
-
- SEE ALSO
- iniFreeContextItem(), iniRemContextItem(), iniInsertContextItem(),
- <libraries/ini_lib.h>
-
- ini.library/iniFloatToStr
-
- NAME
- iniFloatToStr -- Converts a quick float value to a string.
-
-
- SYNOPSIS
- string = iniFloatToStr( Buffer, Float, FltFormat, IntLen, FracLen,
- D0 A0 D0 D1 D2 D3
- ZeroSep );
- D4:8
-
- APTR iniFloatToStr( APTR, ULONG, ULONG, ULONG, ULONG, UBYTE );
-
-
- FUNCTION
- This function is used to convert a quick float value to a standard
- ASCII string. A quick float value has in it's upper 16-bits the
- decimal value and in the lower 16-bits the fraction. That means, the
- highest possible accuracy is 1/65536.
-
-
- INPUTS
- Buffer - A pointer to at least a 128 byte buffer or NULL to create a
- new one.
- Float - Quick float value to convert.
- FltFormat - Format of the floating point value. Can be any of:
- INI_FLOAT_FORMAT_DEC - Use decimal with point separator
- INI_FLOAT_UNSIGNED - Add this to indicate unsigned quick float
- IntLen - Forced length of integer part or NULL for no force.
- FracLen - Forced length of fractional part or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
- string - Pointer to the string where the converted string is stored.
-
-
- EXAMPLE
-
-
- NOTES
-
-
- BUGS
- The buffer is not checked for overflow. That means, IntLen and FracLen
- should not be greater than 90% of your buffer when added together.
-
-
- SEE ALSO
- iniStrToFloat(), iniStrToInt(), iniIntToStr(), <libraries/ini_lib.h>
-
-
- ini.library/iniFreeContext
-
- NAME
- iniFreeContext -- Deletes if necessary and deallocates a context
- structure.
-
-
- SYNOPSIS
- iniFreeContext( ContextStr );
- A0
-
- void iniFreeContext( struct ContextStr *);
-
-
- FUNCTION
- This function removes first (see iniDeleteContext()), if necessary a
- context structure and then deallocates the memory used by it using
- iniFreePMem() and iniFreeNameStr().
-
-
- INPUTS
- ContextStr - A pointer to a context structure to be deallocated.
-
-
- RESULT
-
-
- EXAMPLE
-
-
- NOTES
- The structure MUST be allocated with iniAllocPMem() and the strings
- must be allocated with iniAllocNameStr()
-
-
- BUGS
-
-
- SEE ALSO
- iniCreateContext(), iniRemContext(), iniDeleteContext(),
- iniFreeContextItem(), <libraries/ini_lib.h>
-
-
- ini.library/iniFreeContextItem
-
- NAME
- iniFreeContextItem -- Deallocates a context item structure
-
-
- SYNOPSIS
- iniFreeContextItem( ContextItemLine );
- A0
-
- void iniFreeContextItem( struct ContextItemLine *);
-
-
- FUNCTION
- Removes (if necessary) a context item line and deallocates the memory
- required by it afterwards. iniFreePMem() and iniFreeNameStr() are
- used for deallocation.
-
-
- INPUTS
- ContextItemLine - Pointer to the context item line to be deallocated.
-
-
- RESULT
-
-
- EXAMPLE
-
-
- NOTES
- The structure MUST be allocated with iniAllocPMem() and the strings
- need to be allocated with iniAllocNameStr().
-
-
- BUGS
-
-
- SEE ALSO
- iniCreateContextItem(), iniRemContextItem(), iniDeleteContextItem(),
- iniFreeContext(), <libraries/ini_lib.h>
-
-
- ini.library/iniFreeNameStr
-
- NAME
- iniFreeNameStr -- Deallocate an iniAllocNameStr() name structure.
-
-
- SYNOPSIS
- iniFreeNameStr( namestring );
- A0
-
- void iniFreeNameStr( APTR );
-
-
- FUNCTION
- Deallocates a name structure, allocated previously by
- iniAllocNameStr()
-
-
- INPUTS
- namestring - A pointer to a previously allocated name string. The
- size of deallocation is calculated automatically.
-
-
- RESULT
-
-
- EXAMPLE
-
-
- NOTES
- Please deallocate ONLY those things allocated with iniAllocNameStr()
- with this function, since the allocation mechanism may change at any
- time!
-
-
- BUGS
-
-
- SEE ALSO
- iniAllocNameStr(), iniAllocPMem(), iniFreePMem()
-
-
- ini.library/iniFreePMem
-
- NAME
- iniFreePMem -- deallocates memory allocated by iniAllocPMem()
-
-
- SYNOPSIS
- iniFreePMem( memoryBlock, byteSize)
- A1 D0
-
- void iniFreePMem( APTR, ULONG );
-
-
- FUNCTION
- Deallocates any memory allocated by iniFreePMem(), it works just like
- the exec.library/FreeMem function.
-
-
- INPUTS
- memoryBlock - The block that should be deallocated
- byteSize - Number of bytes to be deallocated. It is aligned
- automatically.
-
-
- RESULT
-
-
- EXAMPLE
-
-
- NOTES
- Please use this function to deallocate ONLY iniAllocPMem() blocks,
- if you don't do this, the system may crash within OS3.0+, since the
- function uses memory pools in that case.
-
-
- BUGS
-
-
- SEE ALSO
- iniAllocPMem()
-
-
- ini.library/iniGetArrayLine
-
- NAME
- iniGetArrayLine -- Returns the array line of the context item number
-
-
- SYNOPSIS
- ContextItemPos = iniGetArrayLine( ContextStr, ContextItemLine,
- D0 A0 A1
- Number );
- D0
-
- struct ContextItemLine *iniGetArrayLine( struct ContextStr *,
- struct ContextItemLine *, ULONG );
-
-
- FUNCTION
- Gets the context item line structure of the given context item's nth
- array (nth is the Number given in D0)
-
-
- INPUTS
- ContextStr - Context structure where context item is
- ContextItemLine - Context item line where's array's first entry.
- Number - Array number of which the line address should be returned.
-
-
- RESULT
- ContextItemLine - Context item line address of the number given.
-
-
- EXAMPLE
-
-
- NOTES
- This function is mainly only for internal purposes. It allows
- array handling faster.
-
-
- BUGS
-
-
- SEE ALSO
- iniGetNumArrays(), iniGetArrayPos(), <libraries/ini_lib.h>
-
-
- ini.library/iniGetArrayPos
-
- NAME
- iniGetArrayPos -- Returns the position of the context item number.
-
-
- SYNOPSIS
- ContextItemPos = iniGetArrayPos( ContextStr, ContextItemLine,
- D0 A0 A1
- Number );
- D0
-
- struct ContextItemLine *iniGetArrayPos( struct ContextStr *,
- struct ContextItemLine *, ULONG );
-
-
- FUNCTION
- Gets the line position of the given context item's nth array
- (nth is the Number given in D0)
-
-
- INPUTS
- ContextStr - Context structure where context item is
- ContextItemLine - Context item line where's array's first entry.
- Number - Array number of which the line position should be returned.
-
-
- RESULT
- ContextItemLine - Context item line address of the number given.
-
-
- EXAMPLE
-
-
- NOTES
- This function is mainly only for internal purposes. It allows
- easy array access.
-
-
- BUGS
-
-
- SEE ALSO
- iniGetNumArrays(), iniGetArrayLine(), <libraries/ini_lib.h>
-
-
- ini.library/iniGetByteA
-
- NAME
- iniGetByteA -- reads a context item array into a (U)BYTE array.
-
-
- SYNOPSIS
- success = iniGetByteA( ContextStr, ContextItemLine, Array, Entries );
- D0 A0 A1 A2 D0
-
- BOOL iniGetByteA( struct ContextStr *, struct ContextItemLine *,
- struct Array *, ULONG );
-
-
- FUNCTION
- Reads a context item array and stores the read bytes into a
- (U)BYTE table you specified.
-
-
- INPUTS
- ContextStr - The context structure where the context line is in
- ContextItemLine - The context item line where the array is
- Array - An (U)BYTE array where to store the values
- Entries - Number of entries to read (further entries will be ignored)
-
-
- RESULT
- success - TRUE if line could be evaluated else FALSE
-
-
- EXAMPLE
-
-
- NOTES
- Make sure that the given array is big enough to hold all values or
- some memory area may be overwritten.
-
- Fields which can't be evaluated are left unchanged.
-
-
- BUGS
-
-
- SEE ALSO
- iniGetWordA(), iniGetLongA(), iniReadByteA(), iniPutByteA(),
- <libraries/ini_lib.h>
-
-
- ini.library/iniGetContextItem
-
- NAME
- iniGetContextItem -- Gets the name of the context item
-
-
- SYNOPSIS
- Buffer = iniGetContextItem( ContextStr, ContextItemLine, Buffer );
- D0 A0 A1 A2
-
- APTR iniGetContextItem( struct ContextStr *, struct ContextItemLine *,
- APTR );
-
-
- FUNCTION
- Gets the context item name of the context item line given
-
-
- INPUTS
- ContextStr - Context structure where context item lies
- ContextItemLine - Pointer to context item line structure
- Buffer - Optional buffer where to store name or NULL to create new
-
-
- RESULT
- Buffer - APTR to newly created buffer if none was specified or NULL
- on error. If existing buffer was given, it will be returned
- instead.
-
-
- EXAMPLE
-
-
- NOTES
- This function is called by all functions which evaluate INI file
- context item data. It is, in fact, a low level function. The given
- buffer must have a mininum size of 128 bytes.
- If no buffer is given, the new one must be freed with iniFreeNameStr()
-
-
- BUGS
-
-
- SEE ALSO
- iniGetContextName(), iniGetContextItemData(),
- iniGetContextItemDataA(), <libraries/ini_lib.h>
-
-
- ini.library/iniGetContextItemData
-
- NAME
- iniGetContextItemData -- Gets the data of the context item
-
-
- SYNOPSIS
- Buffer = iniGetContextItemData( ContextStr, ContextItemLine, Buffer );
- D0 A0 A1 A2
-
- APTR iniGetContextItemData( struct ContextStr *,
- struct ContextItemLine *, APTR );
-
-
- FUNCTION
- Gets the context item data of the context item line given
-
-
- INPUTS
- ContextStr - Context structure where context item data lies
- ContextItemLine - Pointer to context item line structure
- Buffer - Optional buffer where to store data or NULL to create new
-
-
- RESULT
- Buffer - APTR to newly created buffer if none was specified or NULL
- on error. If existing buffer was given, it will be returned
- instead.
-
-
- EXAMPLE
-
-
- NOTES
- This function is called by all functions which evaluate INI file
- context item data. It is, in fact, a low level function. The given
- buffer must have a mininum size of 128 bytes.
- If no buffer is given, the new one must be freed with iniFreeNameStr()
-
-
- BUGS
-
-
- SEE ALSO
- iniGetContextName(), iniGetContextItem(), iniContextItemDataA(),
- <libraries/ini_lib.h>
-
-
- ini.library/iniGetContextItemDataA
-
- NAME
- iniGetContextItemDataA -- Gets the data of the context item array
-
-
- SYNOPSIS
- Buffer = iniGetContextItemDataA( ContextStr, ContextItemLine,
- D0 A0 A1
- Buffer, Number );
- A2 D0
-
- APTR iniGetContextItemDataA( struct ContextStr *,
- struct ContextItemLine *, APTR, ULONG );
-
-
- FUNCTION
- Gets the context item array data of the context item line given
-
-
- INPUTS
- ContextStr - Context structure where context item array lies
- ContextItemLine - Pointer to context item line structure
- Buffer - Optional buffer where to store data or NULL to create new
- Number - The entry which should be extracted out of the array. NULL
- is the first one
-
-
- RESULT
- Buffer - APTR to newly created buffer if none was specified or NULL
- on error. If existing buffer was given, it will be returned
- instead.
-
-
- EXAMPLE
-
-
- NOTES
- This function is called by all functions which evaluate INI file
- context item array data. It is, in fact, a low level function. The
- given buffer must have a mininum size of 128 bytes.
- If no buffer is given, the new one must be freed with iniFreeNameStr()
-
-
- BUGS
-
-
- SEE ALSO
- iniGetContextName(), iniGetContextItem(), iniGetContextItemData(),
- <libraries/ini_lib.h>
-
-
- ini.library/iniGetContextName
-
- NAME
- iniGetContextName - Gets the name of the context
-
-
- SYNOPSIS
- Buffer = iniGetContextName( ContextLine, Buffer );
- D0 A0 A1
-
- APTR iniGetContextName( char ContextLine *, APTR );
-
-
- FUNCTION
- Gets the context name of the context line given
-
-
- INPUTS
- ContextStr - Context structure where context line lies
- Buffer - Optional buffer where to store name or NULL to create new
-
-
- RESULT
- Buffer - APTR to newly created buffer if none was specified or NULL
- on error. If existing buffer was given, it will be returned
- instead.
-
-
- EXAMPLE
-
-
- NOTES
- This function is called by all functions which evaluate INI file
- context names. It is, in fact, a low level function. The given
- buffer must have a mininum size of 128 bytes.
- If no buffer is given, the new one must be freed with iniFreeNameStr()
-
-
- BUGS
-
-
- SEE ALSO
- iniGetContextItem(), iniGetContextItemData(),
- iniGetContextItemDataA(), <libraries/ini_lib.h>
-
-
- ini.library/iniGetFloat
-
- NAME
- iniGetFloat -- Gets a quick floating point value
-
-
- SYNOPSIS
- QFloatValue = iniGetFloat( ContextStr, ContextItemLine, Default );
- D0 A0 A1 D0
-
- ULONG iniGetFloat( struct ContextStr *, struct ContextItemLine *,
- ULONG );
-
-
- FUNCTION
- Reads a quick float value out of the given context item line
-
-
- INPUTS
- ContextStr - Context structure where quick float value lies in
- ContextItemLine - Context item line where to extract quick float
- Default - Default value to take if it can't be evaluated
-
-
- RESULT
- QFloatValue - The quick float value extracted out of the context item
- line
-
-
- EXAMPLE
-
-
- NOTES
- This function is called from iniReadFloat().
- Only the first four fractional digits are evaluated. However, the
- 5th digit is evaluated for rounding purposes.
-
-
- BUGS
-
-
- SEE ALSO
- iniGetLong(), iniGetStr(), iniGetFloatA(), iniPutFloat(),
- iniReadFloat(), iniWriteFloat(), <libraries/ini_lib.h>
-
-
- ini.library/iniGetFloatA
-
- NAME
- iniGetFloatA -- Gets quick floating point value(s) out of an array
-
-
- SYNOPSIS
- success = iniGetFloatA( ContextStr, ContextItemLine, Array, Entries );
- D0 A0 A1 A2 D0
-
- BOOL iniGetFloatA( struct ContextStr *, struct ContextItemLine *,
- struct Array *, ULONG );
-
-
- FUNCTION
- Reads one or more quick float value(s) out of the given context item
- line
-
-
- INPUTS
- ContextStr - Context structure where quick float values lie in
- ContextItemLine - Context item line where to extract quick floats
- Array - The array where to store the quick float values
- Entries - Number of array entries. If the array in the INI file is
- bigger, the remaining entries will be ignored.
-
-
- RESULT
- success - TRUE if accessing was successful else NULL.
-
-
- EXAMPLE
-
-
- NOTES
- This function is called from iniReadFloatA().
- Only the first four fractional digits are evaluated. However, the
- 5th digit is evaluated for rounding purposes.
- Array fields which can't be evaluated (e.g. bad syntax) are left
- unchanged. So it's good to fill the array with default values first.
-
-
- BUGS
-
-
- SEE ALSO
- iniGetLongA(), iniGetStrA(), iniGetFloat(), iniPutFloatA(),
- iniReadFloatA(), iniWriteFloatA(), <libraries/ini_lib.h>
-
-
- ini.library/iniGetLong
-
- NAME
- iniGetLong -- Gets a long integer value
-
-
- SYNOPSIS
- LongValue = iniGetLong( ContextStr, ContextItemLine, Default );
- D0 A0 A1 D0
-
- ULONG iniGetLong( struct ContextStr *, struct ContextItemLine *,
- ULONG );
-
-
- FUNCTION
- Reads a long integer value out of the given context item line
-
-
- INPUTS
- ContextStr - Context structure where long integer value lies in
- ContextItemLine - Context item line where to extract long integer
- Default - Default value to take if it can't be evaluated
-
-
- RESULT
- LongValue - The long integer value extracted out of the context item
- line
-
-
- EXAMPLE
-
-
- NOTES
- This function is called from iniReadLong().
-
-
- BUGS
-
-
- SEE ALSO
- iniGetFloat(), iniGetStr(), iniGetLongA(), iniPutLong(),
- iniReadLong(), iniWriteLong(), <libraries/ini_lib.h>
-
-
- ini.library/iniGetLongA
-
- NAME
- iniGetLongA -- Gets long integer value(s) out of an array
-
-
- SYNOPSIS
- success = iniGetLongA( ContextStr, ContextItemLine, Array, Entries );
- D0 A0 A1 A2 D0
-
- BOOL iniGetLongA( struct ContextStr *, struct ContextItemLine *,
- struct Array *, ULONG );
-
-
- FUNCTION
- Reads one or more long integer value(s) out of the given context item
- line
-
-
- INPUTS
- ContextStr - Context structure where long integer values lie in
- ContextItemLine - Context item line where to extract long integers
- Array - The array where to store the long integer values
- Entries - Number of array entries. If the array in the INI file is
- bigger, the remaining entries will be ignored.
-
-
- RESULT
- success - TRUE if accessing was successful else NULL.
-
-
- EXAMPLE
-
-
- NOTES
- This function is called from iniReadLongA().
- Array fields which can't be evaluated (e.g. bad syntax) are left
- unchanged. So it's good to fill the array with default values first.
-
-
- BUGS
-
-
- SEE ALSO
- iniGetFloatA(), iniGetStrA(), iniGetLong(), iniPutLongA(),
- iniReadLongA(), iniWriteLongA(), <libraries/ini_lib.h>
-
-
- ini.library/iniGetNumArrays
-
- NAME
- iniGetNumArrays -- Gets the amount of array fields
-
-
- SYNOPSIS
- Arrays = iniGetNumArrays( ContextStr, ContextItemLine );
- D0 A0 A1
-
- ULONG iniGetNumArrays( struct ContextStr *,
- struct ContextItemLine *);
-
-
- FUNCTION
- Returns the amount of array entries in the given context item array.
-
-
- INPUTS
- ContextStr - Context structure where array lies in
- ContextItemLine - Context item line structure where array starts
-
-
- RESULT
- Arrays - Number of arrays in the given context item line
-
- EXAMPLE
-
-
- NOTES
- This function usually is used for dynamic array fields.
- If an error occurs during evaluation, NULL is returned.
-
-
- BUGS
-
-
- SEE ALSO
- iniGetLongA(), iniGetWordA(), iniGetByteA(), iniGetFloatA(),
- iniGetStrA(), <libraries/ini_lib.h>
-
-
- ini.library/iniGetStr
-
- NAME
- iniGetStr -- Gets a string
-
-
- SYNOPSIS
- String = iniGetStr( ContextStr, ContextItemLine, Default );
- D0 A0 A1 A2
-
- APTR iniGetStr( struct ContextStr *, struct ContextItemLine *, APTR );
-
-
- FUNCTION
- Reads a string out of the given context item line
-
-
- INPUTS
- ContextStr - Context structure where string lies in
- ContextItemLine - Context item line where to extract string
- Default - Default value to take if it can't be evaluated
-
-
- RESULT
- String - The string extracted out of the context item line
-
-
- EXAMPLE
-
-
- NOTES
- This function is called from iniReadStr().
- This function calls iniGetContextItemData() with no buffer, this
- means that the string returned must be deallocated with
- iniFreeNameStr()
-
-
- BUGS
-
-
- SEE ALSO
- iniGetContextItemData(), iniGetLongA(), iniGetFloatA(), iniGetStr(),
- iniPutStr(), iniReadStrA(), iniWriteStrA(), <libraries/ini_lib.h>
-
-
- ini.library/iniGetStrA
-
- NAME
- iniGetStrA -- Extracts strings out of an array
-
-
- SYNOPSIS
- success = iniGetStrA( ContextStr, ContextItemLine, Array, Entries );
- D0 A0 A1 A2 D0
-
- BOOL iniGetStrA( struct ContextStr *, struct ContextItemLine *,
- struct Array *, ULONG );
-
-
- FUNCTION
- Reads one or more strings out of the given context item line
-
-
- INPUTS
- ContextStr - Context structure where string values lie in
- ContextItemLine - Context item line where to extract strings
- Array - The array where to store the pointers to the strings
- Entries - Number of array entries. If the array in the INI file is
- bigger, the remaining entries will be ignored.
-
-
- RESULT
- success - TRUE if accessing was successful else NULL.
-
-
- EXAMPLE
-
-
- NOTES
- This function is called from iniReadStrA().
- This function calls iniGetContextItemData() with no buffer.
- Array fields which can't be evaluated (e.g. bad syntax) are left
- unchanged. So it's good to fill the array with default strings first.
- All entries of the array must be deallocated with iniFreeNameStr()
- when the strings are no longer of use. This means that the default
- entries of the array must be iniAllocNameStr() strings!
-
-
- BUGS
-
-
- SEE ALSO
- iniGetLongA(), iniGetFloatA(), iniGetStr(), iniPutStrA(),
- iniReadStrA(), iniWriteStrA(), <libraries/ini_lib.h>
-
-
- ini.library/iniGetWordA
-
- NAME
- iniGetWordA -- reads a context item array into a (U)WORD array.
-
-
- SYNOPSIS
- success = iniGetWordA( ContextStr, ContextItemLine, Array, Entries );
- D0 A0 A1 A2 D0
-
- BOOL iniGetWordA( struct ContextStr *, struct ContextItemLine *,
- struct Array *, ULONG );
-
-
- FUNCTION
- Reads a context item array and stores the read words into a
- (U)WORD table you specified.
-
-
- INPUTS
- ContextStr - The context structure where the context line is in
- ContextItemLine - The context item line where the array is
- Array - An (U)WORD array where to store the values
- Entries - Number of entries to read (further entries will be ignored)
-
-
- RESULT
- success - TRUE if line could be evaluated else FALSE
-
-
- EXAMPLE
-
-
- NOTES
- Make sure that the given array is big enough to hold all values or
- some memory area may be overwritten.
-
- Fields which can't be evaluated are left unchanged.
-
-
- BUGS
-
-
- SEE ALSO
- iniGetByteA(), iniGetLongA(), iniReadWordA(), iniPutWordA(),
- <libraries/ini_lib.h>
-
-
- ini.library/iniInsertContext
-
- NAME
- iniInsertContext -- inserts a context in an INI file structure
-
-
- SYNOPSIS
- iniInsertContext( iniFile, ContextStr, PredContext );
- A0 A1 A2
-
- void iniInsertContext( struct iniFile *, struct ContextStr *,
- struct PredContext *);
-
-
- FUNCTION
- Inserts a context in an INI file and all its associated lines.
-
-
- INPUTS
- iniFile - INI file structure where to insert context structure
- ContextStr - The context structure to be inserted
- PredContext - Context structure of the structure where to insert it
-
-
- RESULT
-
-
- EXAMPLE
-
-
- NOTES
-
-
- BUGS
-
-
- SEE ALSO
- iniFreeContext(), iniRemContext(), iniDeleteContext(),
- <libraries/ini_lib.h>
-
-
- ini.library/iniInsertContextItem
-
- NAME
- iniInsertContextItem -- inserts a context item line in an INI file.
-
-
- SYNOPSIS
- iniInsertContextItem( ContextStr, ContextItemLine, PredLine );
- A0 A1 A2
-
- void iniInsertContextItem( struct ContextStr *,
- struct ContextItemLine *, struct PredLine *);
-
-
- FUNCTION
- Inserts a context item line in an INI context.
-
-
- INPUTS
- ContextStr - The pointer of the context structure where to insert item
- ContextItemLine - The pointer of the context item line to be inserted.
- PredLine - The context item line where to insert it.
-
-
- RESULT
-
-
- EXAMPLE
-
-
- NOTES
-
-
- BUGS
-
-
- SEE ALSO
- iniFreeContextItem(), iniRemContextItem(), iniDeleteContextItem(),
- <libraries/ini_lib.h>
-
- ini.library/iniIntToStr
-
- NAME
- iniIntToStr -- Converts an integer value to a string.
-
-
- SYNOPSIS
- string = iniIntToStr( Buffer, Integer, Format, Len, ZeroSep );
- D0 A0 D0 D1 D2 D3:8
-
- APTR iniIntToStr( APTR, ULONG, ULONG, ULONG, UBYTE );
-
-
- FUNCTION
- This function is used to convert an integer value to a standard
- ASCII string.
-
-
- INPUTS
- Buffer - A pointer to at least a 128 byte buffer or NULL to create a
- new one.
- Integer - Integer value to convert.
- Format - Format of the outputted string. Can be any of:
- INI_FORMAT_DEC - Use decimal with no precedor
- INI_FORMAT_DEC_CHAR - Use decimal with # precedor
- INI_FORMAT_HEX - Use hexadecimal with $ precedor
- INI_FORMAT_HEX_0X - Use hexadecimal with 0x precedor
- INI_FORMAT_BIN - Use binary with % precedor
- INI_FORMAT_OCT - Use octal with & precedor
- INI_FORMAT_YESNO - Use No for zero, Yes for all others
- INI_FORMAT_YN - Use N for zero, Y for all others
- INI_FORMAT_TRUEFALSE - Use False for zero, True for all others
- INI_FORMAT_ONOFF - Use Off for zero, On for all others
- INI_UNSIGNED - Add this to indicate unsigned integer
- Len - Forced length of outputted string or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
- string - Pointer to the string where the converted string is stored.
-
-
- EXAMPLE
-
-
- NOTES
-
-
- BUGS
- The buffer is not checked for overflow. That means, IntLen should
- should be lesser than your buffer.
-
-
- SEE ALSO
- iniStrToInt(), iniStrToFloat(), iniFloatToStr(), <libraries/ini_lib.h>
-
-
- ini.library/iniOpenDefault
-
- NAME
- iniOpenDefault -- Opens INI file for read access
-
-
- SYNOPSIS
- iniFile = iniOpenDefault( address, name, len );
- D0 A0 A1 D0
-
- struct iniFile *iniOpenDefault( APTR, char name *, ULONG );
-
-
- FUNCTION
- Opens an INI file for read access and creates a iniFile structure
- for it. If the file doesn't exist, a default file will be created.
-
-
- INPUTS
- address - Address where default INI file lies (in memory)
- name - File name of the INI file to be accessed
- len - Length of the default INI file
-
-
- RESULT
- iniFile - A valid INI file structure ready to be evaluated.
-
-
- EXAMPLE
-
-
- NOTES
- The default file will only be created, if the Open() fails with
- an ERROR_OBJECT_NOT_FOUND (code 205) error.
- If the default file can't be created (disk full, etc.) the function
- will use the default file in memory.
-
-
- BUGS
-
-
- SEE ALSO
- iniOpenFile(), iniOpenMem(), iniClose(), iniSaveFile(),
- <libraries/ini_lib.h>
-
-
- ini.library/iniOpenFile
-
- NAME
- iniOpenFile -- Prepares an INI file for context access
-
-
- SYNOPSIS
- iniFile = iniOpenFile( name, accessMode );
- D0 D1 D2
-
- struct iniFile *iniOpenFile( char name *, LONG );
-
-
- FUNCTION
- Opens an INI file for read access and prepares an iniFile structure
- for evaluation. After this the INI file contents can be evaluated
-
-
- INPUTS
- name - Name of the INI file to be opened.
- accessMode - Read mode of file (see <libraries/dos.h> for details)
-
-
- RESULT
- iniFile - An INI file structure which is ready for evaluation
-
-
- EXAMPLE
-
-
- NOTES
-
-
- BUGS
-
-
- SEE ALSO
- iniOpenDefault(), iniOpenFromFH(), iniOpenMem(), iniClose(),
- iniSaveFile(), <libraries/ini_lib.h>, <libraries/dos.h>
-
-
- ini.library/iniOpenFromFH
-
- NAME
- iniOpenFromFH -- initializes an INI file from an already open file
-
-
- SYNOPSIS
- iniFile = iniOpenFromFH( fh, len );
- D0 D1 D2
-
- struct iniFile *iniOpenFromFH( BPTR, ULONG );
-
-
- FUNCTION
- Reads the INI data from an already open file and initializes the
- iniFile structure.
-
-
- INPUTS
- fh - BPTR to an file handle of the already opened file to be read.
- len - Length of file (or length of bytes to read at maximum)
-
-
- RESULT
- iniFile - An initialized INI file structure ready for evaluation
-
-
- EXAMPLE
-
-
- NOTES
-
-
- BUGS
-
-
- SEE ALSO
- iniOpenDefault(), iniOpenFile(), iniOpenMem(), iniClose(),
- iniSaveFile(), iniSaveToFH(), <libraries/ini_lib.h>
-
-
- ini.library/iniOpenMem
-
- NAME
- iniOpenMem -- Initializes a INI file structure from an INI file
- already in memory.
-
-
- SYNOPSIS
- iniFile = iniOpenMem( address, len );
- D0 A0 D0
-
- struct iniFile *iniOpenMem( APTR, ULONG );
-
-
- FUNCTION
- Initializes an INI file structure from an INI file already in
- memory.
-
-
- INPUTS
- address - Address where the INI file lies
- len - Length of INI file in memory
-
-
- RESULT
- iniFile - Valid initialized INI file structure ready to be evaluated
-
-
- EXAMPLE
-
-
- NOTES
-
-
- BUGS
-
-
- SEE ALSO
- iniOpenDefault(), iniOpenFile(), iniOpenFromFH(), iniClose(),
- iniSaveFile(), iniSaveToFH(), <libraries/ini_lib.h>
-
-
- ini.library/iniPutByteA
-
- NAME
- iniPutByteA -- writes an (U)BYTE array into an context item array.
-
-
- SYNOPSIS
- success = iniPutByteA( ContextStr, ContextItemLine, Array, Entries,
- D0 A0 A1 A2 D0
- Format, Len, ZeroSep );
- D1 D2 D3:8
-
- BOOL iniPutByteA( struct ContextStr *, struct ContextItemLine *,
- struct Array *, ULONG, ULONG, ULONG, UBYTE );
-
-
- FUNCTION
- Writes the values of the given (U)BYTE table to the specified context
- item array.
-
-
- INPUTS
- ContextStr - The context structure where context line should be put
- ContextItemLine - The context item line where the array is
- Array - An (U)BYTE array where to take the values from
- Entries - Number of entries to write
- Format - Format of array entries to write out:
- INI_FORMAT_DEC - Use decimal with no precedor
- INI_FORMAT_DEC_CHAR - Use decimal with # precedor
- INI_FORMAT_HEX - Use hexadecimal with $ precedor
- INI_FORMAT_HEX_0X - Use hexadecimal with 0x precedor
- INI_FORMAT_BIN - Use binary with % precedor
- INI_FORMAT_OCT - Use octal with & precedor
- INI_FORMAT_YESNO - Use No for zero, Yes for all others
- INI_FORMAT_YN - Use N for zero, Y for all others
- INI_FORMAT_TRUEFALSE - Use False for zero, True for all others
- INI_FORMAT_ONOFF - Use Off for zero, On for all others
- INI_UNSIGNED - Add this to indicate unsigned integer
- Len - Forced length of outputted string or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
- success - TRUE if line could be written else FALSE
-
-
- EXAMPLE
-
-
- NOTES
- This function is currently relatively slow. Especially with
- arrays with more than 16 entries.
-
-
- BUGS
-
-
- SEE ALSO
- iniPutWordA(), iniPutLongA(), iniWriteByteA(), iniGetByteA(),
- <libraries/ini_lib.h>
-
-
- ini.library/iniPutFloat
-
- NAME
- iniPutFloat -- Puts a quick floating point value into given item line
-
-
- SYNOPSIS
- success = iniPutFloat( ContextStr, ContextItemLine, Value,
- D0 A0 A1 D0
- Format, Len, ZeroSep );
- D1 D2 D3:8
-
- BOOL iniPutFloat( struct ContextStr *, struct ContextItemLine *,
- ULONG, ULONG, UBYTE );
-
-
- FUNCTION
- Writes a quick float value into the given context item line
-
-
- INPUTS
- ContextStr - Context structure where quick float value should be put
- ContextItemLine - Context item line where to store quick float
- Value - Value to be written
- FltFormat - Format of the floating point value. Can be any of:
- INI_FLOAT_FORMAT_DEC - Use decimal with point separator
- INI_FLOAT_UNSIGNED - Add this to indicate unsigned quick float
- IntLen - Forced length of integer part or NULL for no force.
- FracLen - Forced length of fractional part or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
- success - TRUE if successful write else FALSE
-
-
- EXAMPLE
-
-
- NOTES
- This function is called from iniWriteFloat().
-
-
- BUGS
-
-
- SEE ALSO
- iniPutLong(), iniPutStr(), iniPutFloatA(), iniGetFloat(),
- iniWriteFloat(), iniReadFloat(), <libraries/ini_lib.h>
-
-
- ini.library/iniPutFloatA
-
- NAME
- iniPutFloatA -- Puts quick floating point value(s) into item line(s)
-
-
- SYNOPSIS
- success = iniPutFloatA( ContextStr, ContextItemLine, Array, Entries,
- D0 A0 A1 A2 D0
- FltFormat, IntLen, FracLen, ZeroSep );
- D1 D2 D3 D4:8
-
- BOOL iniPutFloatA( struct ContextStr *, struct ContextItemLine *,
- struct Array *, ULONG, ULONG, ULONG, ULONG, UBYTE );
-
-
- FUNCTION
- Writes one or more quick float value(s) from an array into the given
- context item line
-
-
- INPUTS
- ContextStr - Context structure where quick float values should be put
- ContextItemLine - Context item line where to store quick floats
- Array - The array where to take the quick float values from
- Entries - Number of array entries. If the array in the INI file is
- bigger, the remaining entries will be ignored.
- FltFormat - Format of the floating point value. Can be any of:
- INI_FLOAT_FORMAT_DEC - Use decimal with point separator
- INI_FLOAT_UNSIGNED - Add this to indicate unsigned quick float
- IntLen - Forced length of integer part or NULL for no force.
- FracLen - Forced length of fractional part or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
- success - TRUE if accessing was successful else NULL.
-
-
- EXAMPLE
-
-
- NOTES
- This function is called from iniWriteFloatA().
- This function is currently relatively slow. Especially with
- arrays with more than 16 entries.
-
-
- BUGS
-
-
- SEE ALSO
- iniPutLongA(), iniPutStrA(), iniPutFloat(), iniGetFloatA(),
- iniWriteFloatA(), iniReadFloatA(), <libraries/ini_lib.h>
-
-
- ini.library/iniPutLong
-
- NAME
- iniPutLong -- Puts a long integer value into the context item line
-
-
- SYNOPSIS
- success = iniPutLong( ContextStr, ContextItemLine, Value, Format,
- D0 A0 A1 D0 D1
- Len, ZeroSep );
- D2 D3:8
-
- BOOL iniPutLong( struct ContextStr *, struct ContextItemLine *,
- ULONG, ULONG, ULONG, UBYTE );
-
-
- FUNCTION
- Writes a long integer value into the given context item line
-
-
- INPUTS
- ContextStr - Context structure where the long integers should be put
- ContextItemLine - Context item line where to store long integer
- Value - Value to be written
- Format - Format of the outputted string. Can be any of:
- INI_FORMAT_DEC - Use decimal with no precedor
- INI_FORMAT_DEC_CHAR - Use decimal with # precedor
- INI_FORMAT_HEX - Use hexadecimal with $ precedor
- INI_FORMAT_HEX_0X - Use hexadecimal with 0x precedor
- INI_FORMAT_BIN - Use binary with % precedor
- INI_FORMAT_OCT - Use octal with & precedor
- INI_FORMAT_YESNO - Use No for zero, Yes for all others
- INI_FORMAT_YN - Use N for zero, Y for all others
- INI_FORMAT_TRUEFALSE - Use False for zero, True for all others
- INI_FORMAT_ONOFF - Use Off for zero, On for all others
- INI_UNSIGNED - Add this to indicate unsigned integer
- Len - Forced length of outputted string or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
- success - TRUE if value could successfully be written or FALSE
-
-
- EXAMPLE
-
-
- NOTES
- This function is called from iniWriteLong().
-
-
- BUGS
-
-
- SEE ALSO
- iniPutFloat(), iniPutStr(), iniPutLongA(), iniGetLong(),
- iniWriteLong(), iniReadLong(), <libraries/ini_lib.h>
-
-
- ini.library/iniPutLongA
-
- NAME
- iniPutLongA -- Puts long integer value(s) into context item line(s)
-
-
- SYNOPSIS
- success = iniPutLongA( ContextStr, ContextItemLine, Array, Entries,
- D0 A0 A1 A2 D0
- Format, Len, ZeroSep );
- D1 D2 D3:8
-
- BOOL iniPutLongA( struct ContextStr *, struct ContextItemLine *,
- struct Array *, ULONG, ULONG, ULONG, UBYTE );
-
-
- FUNCTION
- Writes one or more long integer value(s) from the given array into
- the specified context item line(s).
-
-
- INPUTS
- ContextStr - Context structure where the long integers should be put
- ContextItemLine - Context item line where to store long integers
- Array - The array where to take the long integer values from
- Entries - Number of array entries.
- Format - Format of the outputted string. Can be any of:
- INI_FORMAT_DEC - Use decimal with no precedor
- INI_FORMAT_DEC_CHAR - Use decimal with # precedor
- INI_FORMAT_HEX - Use hexadecimal with $ precedor
- INI_FORMAT_HEX_0X - Use hexadecimal with 0x precedor
- INI_FORMAT_BIN - Use binary with % precedor
- INI_FORMAT_OCT - Use octal with & precedor
- INI_FORMAT_YESNO - Use No for zero, Yes for all others
- INI_FORMAT_YN - Use N for zero, Y for all others
- INI_FORMAT_TRUEFALSE - Use False for zero, True for all others
- INI_FORMAT_ONOFF - Use Off for zero, On for all others
- INI_UNSIGNED - Add this to indicate unsigned integer
- Len - Forced length of outputted string or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
- success - TRUE if accessing was successful else NULL.
-
-
- EXAMPLE
-
-
- NOTES
- This function is called from iniWriteLongA().
- This function is currently relatively slow. Especially with
- arrays with more than 16 entries.
-
-
- BUGS
-
-
- SEE ALSO
- iniPutFloatA(), iniPutStrA(), iniPutLong(), iniGetLongA(),
- iniWriteLongA(), iniReadLongA(), <libraries/ini_lib.h>
-
-
- ini.library/iniPutStr
-
- NAME
- iniPutStr -- Puts a string into context item line
-
-
- SYNOPSIS
- success = iniPutStr( ContextStr, ContextItemLine, String );
- D0 A0 A1 A2
-
- BOOL iniPutStr( struct ContextStr *, struct ContextItemLine *, APTR );
-
-
- FUNCTION
- Writes a string into the given context item line.
-
-
- INPUTS
- ContextStr - Context structure where string should be put
- ContextItemLine - Context item line where to store string
- String - String to be written
-
-
- RESULT
- success - TRUE if writing was successful else FALSE
-
-
- EXAMPLE
-
-
- NOTES
- This function is called from iniReadStr().
-
-
- BUGS
-
-
- SEE ALSO
- iniPutLongA(), iniPutFloatA(), iniPutStr(), iniGetStr(),
- iniWriteStrA(), iniReadStrA(), <libraries/ini_lib.h>
-
-
- ini.library/iniPutStrA
-
- NAME
- iniPutStrA -- Stores array(s) of string into the context item line(s)
-
-
- SYNOPSIS
- success = iniPutStrA( ContextStr, ContextItemLine, Array, Entries );
- D0 A0 A1 A2 D0
-
- BOOL iniPutStrA( struct ContextStr *, struct ContextItemLine *,
- struct Array *, ULONG );
-
-
- FUNCTION
- Writes one or more strings into the given context item line from an
- specified array.
-
-
- INPUTS
- ContextStr - Context structure where strings should be put
- ContextItemLine - Context item line where to store strings
- Array - The array where to take the pointers to the strings from
- Entries - Number of array entries. If the array in the INI file is
- bigger, the remaining entries will be ignored.
-
-
- RESULT
- success - TRUE if accessing was successful else NULL.
-
-
- EXAMPLE
-
-
- NOTES
- This function is called from iniWriteStrA().
-
-
- BUGS
-
-
- SEE ALSO
- iniPutLongA(), iniPutFloatA(), iniPutStr(), iniGetStrA(),
- iniWriteStrA(), iniReadStrA(), <libraries/ini_lib.h>
-
-
- ini.library/iniPutWordA
-
- NAME
- iniPutWordA -- writes a (U)WORD array into a context item array.
-
-
- SYNOPSIS
- success = iniPutWordA( ContextStr, ContextItemLine, Array, Entries,
- D0 A0 A1 A2 D0
- Format, Len, ZeroSep );
- D1 D2 D3:8
-
- BOOL iniPutWordA( struct ContextStr *, struct ContextItemLine *,
- struct Array *, ULONG, ULONG, ULONG, UBYTE );
-
-
- FUNCTION
- Writes a context item array and stores the write words from a
- (U)WORD table you specified.
-
-
- INPUTS
- ContextStr - The context structure where the context line is in
- ContextItemLine - The context item line where the array is
- Array - An (U)WORD array where to store the values
- Entries - Number of entries to read (further entries will be ignored)
- Format - Format of the outputted string. Can be any of:
- INI_FORMAT_DEC - Use decimal with no precedor
- INI_FORMAT_DEC_CHAR - Use decimal with # precedor
- INI_FORMAT_HEX - Use hexadecimal with $ precedor
- INI_FORMAT_HEX_0X - Use hexadecimal with 0x precedor
- INI_FORMAT_BIN - Use binary with % precedor
- INI_FORMAT_OCT - Use octal with & precedor
- INI_FORMAT_YESNO - Use No for zero, Yes for all others
- INI_FORMAT_YN - Use N for zero, Y for all others
- INI_FORMAT_TRUEFALSE - Use False for zero, True for all others
- INI_FORMAT_ONOFF - Use Off for zero, On for all others
- INI_UNSIGNED - Add this to indicate unsigned integer
- Len - Forced length of outputted string or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
-
-
- EXAMPLE
-
-
- NOTES
- This function is currently relatively slow. Especially with
- arrays with more than 16 entries.
-
-
- BUGS
-
-
- SEE ALSO
- iniPutByteA(), iniPutLongA(), iniWriteWordA(), iniReadWordA(),
- <libraries/ini_lib.h>
-
-
- ini.library/iniReadByteA
-
- NAME
- iniReadByteA -- reads a context item array into a (U)BYTE array.
-
-
- SYNOPSIS
- success = iniReadByteA( iniFile, ContextName, ItemName, Array,
- D0 A0 A1 A2 A3
- Entries, Flags );
- D0 D1
-
- BOOL iniReadByteA( struct iniFile *, APTR, APTR, struct Array *,
- ULONG, ULONG );
-
-
- FUNCTION
- Searches a context item in a context you specified by name and stores
- the read bytes into a (U)BYTE table you specified.
-
-
- INPUTS
- iniFile - INI file to be evaluated
- ContextName - Name of the context where context item is
- ItemName - Name of the context item to be searched
- Array - An (U)BYTE array where to store the values
- Entries - Number of entries to read (further entries will be ignored)
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
-
-
- RESULT
- success - TRUE if line could be evaluated else FALSE
-
-
- EXAMPLE
-
-
- NOTES
- Make sure that the given array is big enough to hold all values or
- some memory area may be overwritten.
-
- Fields which can't be evaluated are left unchanged.
-
-
- BUGS
-
-
- SEE ALSO
- iniReadWordA(), iniReadLongA(), iniGetByteA(), iniWriteByteA(),
- <libraries/ini_lib.h>
-
-
- ini.library/iniReadFloat
-
- NAME
- iniReadFloat -- Reads a quick floating point value
-
-
- SYNOPSIS
- QFloatValue = iniReadFloat( iniFile, ContextName, ItemName, Default,
- D0 A0 A1 A2 D0
- Flags );
- D1
-
- ULONG iniReadFloat( struct iniFile *, APTR, APTR, ULONG, ULONG );
-
-
- FUNCTION
- Searches the INI file for the desired context and the desired context
- items and returns its quick floating point value.
-
-
- INPUTS
-
- iniFile - INI file to be evaluated
- ContextName - Name of the context where context item is
- ItemName - Name of the context item to be searched
- Default - Default value to take if contents could not be evaluated
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
-
-
- RESULT
- QFloatValue - The quick float value extracted out
-
-
- EXAMPLE
-
-
- NOTES
- Only the first four fractional digits are evaluated. However, the
- 5th digit is evaluated for rounding purposes.
-
-
- BUGS
-
-
- SEE ALSO
- iniReadLong(), iniReadStr(), iniReadFloatA(), iniWriteFloat(),
- GetFloat(), iniPutFloat(), <libraries/ini_lib.h>
-
-
- ini.library/iniReadFloatA
-
- NAME
- iniReadFloatA -- Reads quick floating point value(s) into an array
-
-
- SYNOPSIS
- success = iniReadFloatA( iniFile, ContextName, ItemName, Array,
- D0 A0 A1 A2 D0
- Entries, Flags );
-
- BOOL iniReadFloatA( struct iniFile *, APTR, APTR, struct Array *,
- ULONG, ULONG );
-
-
- FUNCTION
- Searches the context given for the string given in context item and
- reads one or more quick float value(s) and stores them into the
- specified array.
-
-
- INPUTS
- iniFile - INI file to be evaluated
- ContextName - Name of the context where context item is
- ItemName - Name of the context item to be searched
- Default - Default value to take if contents could not be evaluated
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
-
-
- RESULT
- success - TRUE if accessing was successful else NULL.
-
-
- EXAMPLE
-
-
- NOTES
- This function is currently relatively slow. Especially with
- arrays with more than 16 entries.
- Only the first four fractional digits are evaluated. However, the
- 5th digit is evaluated for rounding purposes.
- Array fields which can't be evaluated (e.g. bad syntax) are left
- unchanged. So it's good to fill the array with default values first.
-
-
- BUGS
-
-
- SEE ALSO
- iniWriteLongA(), iniWriteStrA(), iniReadFloat(), iniWriteFloatA(),
- iniGetFloatA(), iniPutFloatA(), <libraries/ini_lib.h>
-
-
- ini.library/iniReadLong
-
- NAME
- iniReadLong -- Reads a long integer value
-
-
- SYNOPSIS
- LongValue = iniReadLong( iniFile, ContextName, ItemName, Default,
- D0 A0 A1 A2 D0
- Flags );
- D1
-
- ULONG iniReadLong( struct iniFile *, APTR, APTR, ULONG, ULONG );
-
-
- FUNCTION
- Searches the INI file for the desired context and the desired context
- items and returns its long integer value.
-
-
- INPUTS
-
- iniFile - INI file to be evaluated
- ContextName - Name of the context where context item is
- ItemName - Name of the context item to be searched
- Default - Default value to take if contents could not be evaluated
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
-
-
- RESULT
- LongValue - The long integer extracted out
-
-
- EXAMPLE
-
-
- NOTES
-
-
- BUGS
-
-
- SEE ALSO
- iniReadLong(), iniReadStr(), iniReadFloatA(), iniWriteFloat(),
- GetFloat(), PutFloat(), <libraries/ini_lib.h>
-
-
- ini.library/iniReadLongA
-
- NAME
- iniReadLongA -- Reads long integer value(s) into an array
-
-
- SYNOPSIS
- success = iniReadLongA( iniFile, ContextName, ItemName, Array,
- D0 A0 A1 A2 D0
- Entries, Flags );
-
- BOOL iniReadLongA( struct iniFile *, APTR, APTR, struct Array *,
- ULONG, ULONG );
-
-
- FUNCTION
- Searches the context given for the string given in context item and
- reads one or more long integer value(s) and stores them into the
- specified array.
-
-
- INPUTS
- iniFile - INI file to be evaluated
- ContextName - Name of the context where context item is
- ItemName - Name of the context item to be searched
- Default - Default value to take if contents could not be evaluated
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
-
-
- RESULT
- success - TRUE if accessing was successful else NULL.
-
-
- EXAMPLE
-
-
- NOTES
- Array fields which can't be evaluated (e.g. bad syntax) are left
- unchanged. So it's good to fill the array with default values first.
-
-
- BUGS
-
-
- SEE ALSO
- iniPutLongA(), iniPutStrA(), iniGetFloat(), iniPutFloatA(),
- iniReadFloatA(), iniWriteFloatA(), <libraries/ini_lib.h>
-
-
- ini.library/iniReadStr
-
- NAME
- iniReadStr -- Gets a string
-
-
- SYNOPSIS
- String = iniReadStr( iniFile, ContextName, ItemName, Default,
- D0 A0 A1 A2 A3
- Flags );
- D0
-
- APTR iniReadStr( struct iniFile *, APTR, APTR, APTR, ULONG );
-
-
- FUNCTION
- Searches the given context item in the given context and returns, if
- found the context item data as a string.
-
-
- INPUTS
- iniFile - INI file to be evaluated
- ContextName - Name of the context where context item is
- ItemName - Name of the context item to be searched
- Default - Default string to take if contents could not be evaluated
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
-
-
- RESULT
- String - The string value extracted out
-
-
- EXAMPLE
-
-
- NOTES
- The string returned must be deallocated with iniFreeNameStr() after
- use.
-
-
- BUGS
-
-
- SEE ALSO
- iniReadLongA(), iniReadFloatA(), iniWriteStr(), iniGetStrA(),
- iniPutStrA(), <libraries/ini_lib.h>
-
-
- ini.library/iniReadStrA
-
- NAME
- iniReadStrA -- Extracts strings out of an array
-
-
- SYNOPSIS
- success = iniReadStrA( iniFile, ContextName, ItemName, Array,
- D0 A0 A1 A2 A3
- Entries, Flags );
- D0 D1
-
- BOOL iniReadStrA( struct iniFile *, APTR, APTR, APTR, ULONG, ULONG );
-
-
- FUNCTION
- Searches for the given context item in the given context and reads
- the string(s) into the specified array.
-
-
- INPUTS
- iniFile - INI file to be evaluated
- ContextName - Name of the context where context item is
- ItemName - Name of the context item to be searched
- Array - Array where to put the pointers to the strings
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
-
-
- RESULT
- success - TRUE if accessing was successful else NULL.
-
-
- EXAMPLE
-
-
- NOTES
- Array fields which can't be evaluated (e.g. bad syntax) are left
- unchanged. So it's good to fill the array with default strings first.
- All array fields must be deallocated with iniFreeNameStr() when they
- are not required anymore. This means that the default entries of the
- array must be iniAllocNameStr() strings!
-
- BUGS
-
-
- SEE ALSO
- iniReadLongA(), iniReadFloatA(), iniReadStr(), iniWriteStrA(),
- iniGetStrA(), iniPutStrA(), <libraries/ini_lib.h>
-
-
- ini.library/iniReadWordA
-
- NAME
- iniReadWordA -- reads a context item array into a (U)WORD array.
-
-
- SYNOPSIS
- success = iniReadWordA( iniFile, ContextName, ItemName, Array,
- D0 A0 A1 A2 A3
- Entries, Flags );
- D0 D1
-
- BOOL iniReadWordA( struct iniFile *, APTR, APTR, struct Array *,
- ULONG, ULONG );
-
-
- FUNCTION
- Searches a context item in a context you specified by name and stores
- the read bytes into a (U)WORD table you specified.
-
-
- INPUTS
- iniFile - INI file to be evaluated
- ContextName - Name of the context where context item is
- ItemName - Name of the context item to be searched
- Array - An (U)WORD array where to store the values
- Entries - Number of entries to read (further entries will be ignored)
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
-
-
- RESULT
- success - TRUE if line could be evaluated else FALSE
-
-
- EXAMPLE
-
-
- NOTES
- Make sure that the given array is big enough to hold all values or
- some memory area may be overwritten.
-
- Fields which can't be evaluated are left unchanged.
-
-
- BUGS
-
-
- SEE ALSO
- iniReadByteA(), iniReadLongA(), iniGetWordA(), iniWriteWordA(),
- <libraries/ini_lib.h>
-
-
- ini.library/iniRemContext
-
- NAME
- iniRemContext -- removes the last context from an INI file structure
-
-
- SYNOPSIS
- iniRemContext( iniFile );
- A0
-
- void iniRemContext( struct iniFile *);
-
-
- FUNCTION
- Removes a previously generated and added context from a specified
- INI file structure. The entry removed is the last one.
-
-
- INPUTS
- iniFile - Pointer to INI structure where to remove from
-
-
- EXAMPLE
-
-
- NOTES
- This function *DOESN'T* do any deallocations. It just removes the
- node from the context list.
-
-
- BUGS
-
-
- SEE ALSO
- iniCreateContext(), iniFreeContext(), iniAddContext(),
- iniInsertContext(), iniDeleteContext(), <libraries/ini_lib.h>
-
-
- ini.library/iniRemContextItem
-
- NAME
- iniRemContextItem -- removes the last context item line from a
- context structure
-
-
- SYNOPSIS
- iniRemContextItem( ContextStr );
- A0
-
- void iniRemContextItem( struct ContextStr *);
-
-
- FUNCTION
- Removes a previously generated context item line from a context
- structure. The context item line removed is the last one.
-
-
- INPUTS
- ContextStr - Pointer to context structure where to remove from
-
-
- EXAMPLE
-
-
- NOTES
- This function just removes the node, it *DOESN'T* deallocate any
- memory.
-
-
- BUGS
-
-
- SEE ALSO
- iniCreateContextItem(), iniFreeContextItem(), iniRemContextItem(),
- iniInsertContextItem(), iniDeleteContextItem(), <libraries/ini_lib.h>
-
-
- ini.library/iniSaveFile
-
- NAME
- iniSaveFile -- Saves an .INI file from an INI structure to disk
-
-
- SYNOPSIS
- written = iniSaveFile( iniFile, name, accessMode );
- D0 A0 D1 D2
-
- ULONG iniSaveFile( struct iniFile *, APTR, LONG );
-
-
- FUNCTION
- Saves an INI file to disk using the current INI structure. This
- function usually is called when the user selects 'Save' in an
- application.
-
-
- INPUTS
- iniFile - INI structure to be saved
- name - Name of the INI file to be created.
- accessMode - Write mode of file (see <libraries/dos.h> for details)
-
-
- RESULT
- written - Number of bytes written in total or -1 on error.
-
-
- EXAMPLE
-
-
- NOTES
-
-
- BUGS
-
-
- SEE ALSO
- iniOpen(), iniOpenDefault(), iniOpenFromFH(), iniOpenMem(),
- iniClose(), <libraries/ini_lib.h>, <libraries/dos.h>
-
-
- ini.library/iniSaveToFH
-
- NAME
- iniSaveToFH -- Saves an INI structure to an already opened file
-
-
- SYNOPSIS
- written = iniSaveToFH( fh, iniFile );
- D0 A0 A1
-
- ULONG iniSaveToFH( BPTR, struct iniFile *);
-
-
- FUNCTION
- Writes the INI data from the specified INI structure to the file
- already opened. The file won't be closed after writing, so you can
- add more data manually.
-
-
- INPUTS
- fh - BPTR to an file handle of the already opened file to be written.
- iniFile - INI structure to be saved
-
-
- RESULT
- written - Number of bytes written in total or -1 on error.
-
-
- EXAMPLE
-
-
- NOTES
-
-
- BUGS
-
-
- SEE ALSO
- iniOpenDefault(), iniOpenFile(), iniOpenFromFH(), iniOpenMem(),
- iniClose(), iniSaveFile(), <libraries/ini_lib.h>
-
-
- ini.library/iniSetNameStr
-
- NAME
- iniSetNameStr -- sets a name string in a given structure offset
-
-
- SYNOPSIS
- namestring = iniSetNameStr( StructPos, namestring );
- D0 A0
-
- APTR iniSetNameStr( APTR, char namestring *);
-
-
- FUNCTION
- Stores a name string into an structure position. This is required
- if you use own strings in the library handlers.
-
-
- INPUTS
- StructPos - A memory pointer where the string pointer should be
- assigned.
- namestring - The name string to be assigned.
-
-
- RESULT
- namestring - The name string stored or NULL on error.
-
-
- EXAMPLE
-
-
- NOTES
- The namestring is a copy of string, but it's freed via iniFreePMem()
-
-
- BUGS
-
-
- SEE ALSO
- iniAllocNameStr(), iniFreeNameStr(), iniSetString()
-
-
- ini.library/iniSetString
-
- NAME
- iniSetString -- allocates and sets a name string in a given structure
- offset
-
-
- SYNOPSIS
- namestring = iniSetString( StructPos, string );
- D0 A0
-
- APTR iniSetNameStr( APTR, char string *);
-
-
- FUNCTION
- Allocates a name string out of a standard NULL-terminated C-String
- and assigns the allocated pointer to the structure position.
- This is required if you use own strings in the library handlers.
-
-
- INPUTS
- StructPos - A memory pointer where the string pointer should be
- assigned.
- string - The C-String to be assigned.
-
-
- RESULT
- namestring - The name string stored or NULL on error.
-
-
- EXAMPLE
-
-
- NOTES
- The namestring is a copy of string, but it's freed via iniFreePMem()
-
-
- BUGS
-
-
- SEE ALSO
- iniAllocNameStr(), iniFreeNameStr(), iniSetNameStr()
-
-
- ini.library/iniStrToFloat
-
- NAME
- iniStrToFloat -- Converts a string to a quick float value.
-
-
- SYNOPSIS
- QFloat = iniStrToFloat( String, Default );
- D0 A0 D0
-
- ULONG iniStrToFloat( APTR, ULONG );
-
-
- FUNCTION
- This function is used to convert a standard ASCII string to a
- quick float value. The string may have signs (+/-) and a decimal
- point. A quick float value has in it's upper 16-bits the decimal
- value and in the lower 16-bits the fraction. That means, the highest
- possible accuracy is 1/65536. If the string can't be converted for
- any reason, the default value is used.
-
-
- INPUTS
- String - The string containing the quick float value.
- Default - Default quick float value to use if error.
-
-
- RESULT
- QFloat - The converted quick float value or the default value.
-
-
- EXAMPLE
- Calling the function with a string containing 3.14159 will result in
- QFloat with 3.1416.
-
-
- NOTES
- The string's value may not exceed -65536/+65535 or an overflow error
- will occur. The value after the period will only be interpreted up
- to 4 digits. However, the 5th digit will be interpreted for rounding
- purposes.
-
-
- BUGS
-
-
- SEE ALSO
- iniStrToInt(), iniIntToStr(), iniFloatToStr(), <libraries/ini_lib.h>
-
-
- ini.library/iniStrToInt
-
- NAME
- iniStrToInt -- Converts a string to an (un)signed 32-bit integer.
-
-
- SYNOPSIS
- Integer = iniStrToInt( String, Default );
- D0 A0 D0
-
- ULONG iniStrToInt( APTR, ULONG );
-
-
- FUNCTION
- This function is used to convert a standard ASCII string to a
- standard 32-bit (un)signed integer value. The string may have signs
- (+/-) and can be in hexadecimal, decimal, binary and octal formats.
- Hexadecimal strings are preceded with $ or 0x. Binary strings with
- %, octal strings with & and decimal strings start either with nothing
- or with a #. In addition to this, the following strings will return
- -1: Yes, Y, True, On
- 0: No, N, False, Off
-
- The match isn't case sensitive, so e.g. YES will also return -1.
- This makes evaluations easier of context items like:
- EnableFunction = Yes.
-
- This means that iniReadLong, etc. automatically take care of this.
-
- INPUTS
- String - The string containing the integer value.
- Default - Default integer value to use if error.
-
-
- RESULT
- Integer - The converted integer value or the default value.
-
-
- EXAMPLE
- A string containing: $0037 will return 55 in Integer,
- %001110 will return 14, and &17 will result in 15.
-
-
- NOTES
- However, the string's value may not exceed -4,294,967,296 and
- +4,294,967,295 (32 bit limit) or an overflow error will occur.
- This function is used for all string to integer conversions.
-
-
- BUGS
-
-
- SEE ALSO
- iniStrToFloat(), iniIntToStr(), iniFloatToStr(), <libraries/ini_lib.h>
-
-
- ini.library/iniWriteByteA
-
- NAME
- iniWriteByteA -- writes an (U)BYTE array into an context item array.
-
-
- SYNOPSIS
- success = iniWriteByteA( iniFile, ContextName, ItemName, Array,
- D0 A0 A1 A2 A3
- Entries, Flags, Format, Len, ZeroSep );
- D0 D1 D2 D3 D4:8
-
- BOOL iniWriteByteA( struct iniFile *, APTR, APTR, struct Array *,
- ULONG, ULONG, ULONG, ULONG, UBYTE );
-
-
- FUNCTION
- Writes the values of the given (U)BYTE table to the specified context
- item in the given context.
-
-
- INPUTS
- iniFile - INI structure of the INI file which should be affected
- ContextName - The context name (C-String) in which context to store
- ItemName - The context item name (C-String) in which the context item
- lies to write to.
- Array - An (U)BYTE array where to take the values from
- Entries - Number of entries to write
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
- Format - Format of array entries to write out:
- INI_FORMAT_DEC - Use decimal with no precedor
- INI_FORMAT_DEC_CHAR - Use decimal with # precedor
- INI_FORMAT_HEX - Use hexadecimal with $ precedor
- INI_FORMAT_HEX_0X - Use hexadecimal with 0x precedor
- INI_FORMAT_BIN - Use binary with % precedor
- INI_FORMAT_OCT - Use octal with & precedor
- INI_FORMAT_YESNO - Use No for zero, Yes for all others
- INI_FORMAT_YN - Use N for zero, Y for all others
- INI_FORMAT_TRUEFALSE - Use False for zero, True for all others
- INI_FORMAT_ONOFF - Use Off for zero, On for all others
- INI_UNSIGNED - Add this to indicate unsigned integer
- Len - Forced length of outputted string or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
- success - TRUE if line could be written else FALSE
-
-
- EXAMPLE
-
-
- NOTES
- This function is currently relatively slow. Especially with
- arrays with more than 16 entries.
-
-
- BUGS
-
-
- SEE ALSO
- iniWriteWordA(), iniWriteLongA(), iniPutByteA(), iniReadByteA(),
- <libraries/ini_lib.h>
-
-
- ini.library/iniWriteFloat
-
- NAME
- iniWriteFloat -- Writes a quick floating point value into given
- item line
-
-
- SYNOPSIS
- success = iniWriteFloat( iniFile, ContextName, ItemName, Value,
- D0 A0 A1 A2 D0
- Flags, FltFormat, IntLen, FracLen, ZeroSep );
- D1 D2 D3 D4 D5:8
-
- BOOL iniWriteFloat( struct iniFile *, APTR, APTR, ULONG, ULONG,
- ULONG, ULONG, UBYTE );
-
-
- FUNCTION
- Writes a quick float value into the given context item, belonging
- to the specified context.
-
-
- INPUTS
- iniFile - INI structure of the INI file to be accessed
- ContextName - Name of the context where context item lies
- ItemName - Name of the context item where context item line lies
- Value - Quick float value to be written
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
- FltFormat - Format of the floating point value. Can be any of:
- INI_FLOAT_FORMAT_DEC - Use decimal with point separator
- INI_FLOAT_UNSIGNED - Add this to indicate unsigned quick float
- IntLen - Forced length of integer part or NULL for no force.
- FracLen - Forced length of fractional part or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
- success - TRUE if successful write else FALSE
-
-
- EXAMPLE
-
-
- NOTES
- This function calls from iniPutFloat().
-
-
- BUGS
-
-
- SEE ALSO
- iniWriteLong(), iniWriteStr(), iniWriteFloatA(), iniReadFloat(),
- iniPutFloat(), iniGetFloat(), <libraries/ini_lib.h>
-
-
- ini.library/iniWriteFloatA
-
- NAME
- iniWriteFloatA -- Writes quick floating point value(s) into
- item line(s)
-
-
- SYNOPSIS
- success = iniWriteFloatA( iniFile, ContextName, ItemName, Array,
- D0 A0 A1 A2 A3
- Entries, Flags, FltFormat, IntLen, FracLen,
- D0 D1 D2 D3 D4:8
- ZeroSep );
- D5
-
- BOOL iniWriteFloatA( struct iniFile *, APTR, APTR, struct Array *,
- ULONG, ULONG, ULONG, ULONG, ULONG, UBYTE );
-
-
- FUNCTION
- Writes one or more quick float value(s) from an array into the given
- context item, belonging to the specified context.
-
-
- INPUTS
- iniFile - INI structure where to assign write to
- ContextName - The name of the context to be affected
- ItemName - The name of the context item where to write array to
- Array - The array where to write the quick float values to
- Entries - Number of array entries. If the array in the INI file is
- bigger, the remaining entries will be ignored.
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
- FltFormat - Format of the floating point value. Can be any of:
- INI_FLOAT_FORMAT_DEC - Use decimal with point separator
- INI_FLOAT_UNSIGNED - Add this to indicate unsigned quick float
- IntLen - Forced length of integer part or NULL for no force.
- FracLen - Forced length of fractional part or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
- success - TRUE if accessing was successful else NULL.
-
-
- EXAMPLE
-
-
- NOTES
- This function calls iniPutFloatA().
- This function is currently relatively slow. Especially with
- arrays with more than 16 entries.
-
-
- BUGS
-
-
- SEE ALSO
- iniWriteLongA(), iniWriteStrA(), iniWriteFloat(), iniReadFloatA(),
- iniPutFloatA(), iniGetFloatA(), <libraries/ini_lib.h>
-
-
- ini.library/iniWriteLong
-
- NAME
- iniWriteLong -- Writes a long integer value into the context item line
-
-
- SYNOPSIS
- success = iniWriteLong( iniFile, ContextName, ItemName, Value,
- D0 A0 A1 A2 D0
- Flags, Format, Len, ZeroSep );
- D1 D2 D3 D4:8
-
- BOOL iniWriteLong( struct iniFile *, APTR, APTR, ULONG, ULONG, ULONG,
- UBYTE );
-
-
- FUNCTION
- Writes a long integer value into the specified context item line,
- belonging to the given context.
-
-
- INPUTS
- iniFile - INI structure of the INI file which should be affected
- ContextName - Name of the context where the value should be stored
- ItemName - Name of the context item where to store value to
- Value - Value to be written
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
- Format - Format of the outputted string. Can be any of:
- INI_FORMAT_DEC - Use decimal with no precedor
- INI_FORMAT_DEC_CHAR - Use decimal with # precedor
- INI_FORMAT_HEX - Use hexadecimal with $ precedor
- INI_FORMAT_HEX_0X - Use hexadecimal with 0x precedor
- INI_FORMAT_BIN - Use binary with % precedor
- INI_FORMAT_OCT - Use octal with & precedor
- INI_FORMAT_YESNO - Use No for zero, Yes for all others
- INI_FORMAT_YN - Use N for zero, Y for all others
- INI_FORMAT_TRUEFALSE - Use False for zero, True for all others
- INI_FORMAT_ONOFF - Use Off for zero, On for all others
- INI_UNSIGNED - Add this to indicate unsigned integer
- Len - Forced length of outputted string or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
- success - TRUE if value could successfully be written or FALSE
-
-
- EXAMPLE
-
-
- NOTES
- This function calls iniPutLong().
-
-
- BUGS
-
-
- SEE ALSO
- iniWriteFloat(), iniWriteStr(), iniWriteLongA(), iniReadLong(),
- iniPutLong(), iniGetLong(), <libraries/ini_lib.h>
-
-
- ini.library/iniWriteLongA
-
- NAME
- iniWriteLongA -- writes an (U)LONG array into an context item array.
-
-
- SYNOPSIS
- success = iniWriteLongA( iniFile, ContextName, ItemName, Array,
- D0 A0 A1 A2 A3
- Entries, Flags, Format, Len, ZeroSep );
- D0 D1 D2 D3 D4:8
-
- BOOL iniWriteLongA( struct iniFile *, APTR, APTR, struct Array *,
- ULONG, ULONG, ULONG, ULONG, UBYTE );
-
-
- FUNCTION
- Writes the values of the given (U)LONG table to the specified context
- item in the given context.
-
-
- INPUTS
- iniFile - INI structure of the INI file which should be affected
- ContextName - The context name (C-String) in which context to store
- ItemName - The context item name (C-String) in which the context item
- lies to write to.
- Array - An (U)LONG array where to take the values from
- Entries - Number of entries to write
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
- Format - Format of array entries to write out:
- INI_FORMAT_DEC - Use decimal with no precedor
- INI_FORMAT_DEC_CHAR - Use decimal with # precedor
- INI_FORMAT_HEX - Use hexadecimal with $ precedor
- INI_FORMAT_HEX_0X - Use hexadecimal with 0x precedor
- INI_FORMAT_BIN - Use binary with % precedor
- INI_FORMAT_OCT - Use octal with & precedor
- INI_FORMAT_YESNO - Use No for zero, Yes for all others
- INI_FORMAT_YN - Use N for zero, Y for all others
- INI_FORMAT_TRUEFALSE - Use False for zero, True for all others
- INI_FORMAT_ONOFF - Use Off for zero, On for all others
- INI_UNSIGNED - Add this to indicate unsigned integer
- Len - Forced length of outputted string or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
- success - TRUE if line could be written else FALSE
-
-
- EXAMPLE
-
-
- NOTES
- This function is currently relatively slow. Especially with
- arrays with more than 16 entries.
-
-
- BUGS
-
-
- SEE ALSO
- iniWriteByteA(), iniWriteWordA(), iniPutLongA(), iniReadLongA(),
- <libraries/ini_lib.h>
-
-
- ini.library/iniWriteStr
-
- NAME
- iniWriteStr -- Writes a string into a context item line
-
-
- SYNOPSIS
- success = iniWriteStr( iniFile, ContextName, ItemName, String,
- D0 A0 A1 A2 A3
- Flags );
- D0
-
-
- BOOL iniWriteStr( struct iniFile *, APTR, APTR, APTR, ULONG );
-
-
- FUNCTION
- Writes a string into the given context item belonging to the
- specified context.
-
-
- INPUTS
- iniFile - INI structure of the INI file to be written
- ContextName - Name of the context where the item lies
- ItemName - Name of the context item where string should be put
- String - String to be written
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
-
-
- RESULT
- success - TRUE if writing was successful else FALSE
-
-
- EXAMPLE
-
-
- NOTES
- This function is called from iniReadStr().
-
-
- BUGS
-
-
- SEE ALSO
- iniWriteLongA(), iniWriteFloatA(), iniWriteStr(), iniReadStr(),
- iniPutStrA(), iniGetStrA(), <libraries/ini_lib.h>
-
-
- ini.library/iniWriteStrA
-
- NAME
- iniWriteStrA -- Writes an array of string(s) into the context item
- line(s)
-
-
- SYNOPSIS
- success = iniWriteStrA( iniFile, ContextName, ItemName, Array,
- D0 A0 A1 A2 A3
- Entries, Flags );
- D0 D1
-
- BOOL iniWriteStrA( struct iniFile *, APTR, APTR, struct Array *,
- ULONG, ULONG );
-
-
- FUNCTION
- Writes one or more strings into the given context item line,
- belonging to the specified context from an given array.
-
-
- INPUTS
- iniFile - INI file structure
- ContextName - Name of the context where context item lies
- ItemName - Name of the context item to be accessed
- Array - The array where to take the pointers of the strings from
- Entries - Number of array entries. If the array in the INI file is
- bigger, the remaining entries will be ignored.
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
-
-
- RESULT
- success - TRUE if accessing was successful else NULL.
-
-
- EXAMPLE
-
-
- NOTES
- This function calls iniPutStrA().
-
-
- BUGS
-
-
- SEE ALSO
- iniWriteLongA(), iniWriteFloatA(), iniWriteStr(), iniReadStrA(),
- iniPutStrA(), iniGetStrA(), <libraries/ini_lib.h>
-
-
- ini.library/iniWriteWordA
-
- NAME
- iniWriteWordA -- writes an (U)WORD array into an context item array.
-
-
- SYNOPSIS
- success = iniWriteWordA( iniFile, ContextName, ItemName, Array,
- D0 A0 A1 A2 A3
- Entries, Flags, Format, Len, ZeroSep );
- D0 D1 D2 D3 D4:8
-
- BOOL iniWriteWordA( struct iniFile *, APTR, APTR, struct Array *,
- ULONG, ULONG, ULONG, ULONG, UBYTE );
-
-
- FUNCTION
- Writes the values of the given (U)WORD table to the specified context
- item in the given context.
-
-
- INPUTS
- iniFile - INI structure of the INI file which should be affected
- ContextName - The context name (C-String) in which context to store
- ItemName - The context item name (C-String) in which the context item
- lies to write to.
- Array - An (U)WORD array where to take the values from
- Entries - Number of entries to write
- Flags - Search flags. They're currently defined as:
- INIF_ContextCase - Set this flag if the search of the context
- name should be case sensitive.
- INIF_ContextItemCase - Set this flag if the search of the context
- item name should be case sensitive.
- Format - Format of array entries to write out:
- INI_FORMAT_DEC - Use decimal with no precedor
- INI_FORMAT_DEC_CHAR - Use decimal with # precedor
- INI_FORMAT_HEX - Use hexadecimal with $ precedor
- INI_FORMAT_HEX_0X - Use hexadecimal with 0x precedor
- INI_FORMAT_BIN - Use binary with % precedor
- INI_FORMAT_OCT - Use octal with & precedor
- INI_FORMAT_YESNO - Use No for zero, Yes for all others
- INI_FORMAT_YN - Use N for zero, Y for all others
- INI_FORMAT_TRUEFALSE - Use False for zero, True for all others
- INI_FORMAT_ONOFF - Use Off for zero, On for all others
- INI_UNSIGNED - Add this to indicate unsigned integer
- Len - Forced length of outputted string or NULL for no force.
- ZeroSep - Zero character for IntLen leading zeroes. Usually " " or "0"
-
-
- RESULT
- success - TRUE if line could be written else FALSE
-
-
- EXAMPLE
-
-
- NOTES
- This function is currently relatively slow. Especially with
- arrays with more than 16 entries.
-
-
- BUGS
-
-
- SEE ALSO
- iniWriteByteA(), iniWriteLongA(), iniPutWordA(), iniReadWordA(),
- <libraries/ini_lib.h>
-
-
-